<#assign base=request.contextPath>
<!DOCTYPE html> 
<html>
<head>
    <title></title>
    <meta charset="utf-8">
		<#include "common/reference.ftl" />
		<#include "common/ligerui.ftl" />
    <script type="text/javascript">
        <!--
        var ligerTable = null;
        $(function(){
            $('.select-chosen').chosen();
            ligerTable = $('#table').ligerGrid({
                width:'98%',
                enabledSort:false,
                pageSizeOptions:[5,10,20,50,100,200],
                height:'auto',
                alternatingRow:true,
                url:'${base}/${route}/platform_driver/getList',
                delayLoad:false,
                columns:[
                    {display:'公司标识',name:'companyId',id:'companyId',align:'center',minWidth:80},
                    {display:'注册地行政区划代码',name:'address',id:'address',align:'center',minWidth:80},
                    {display:'机动车驾驶员姓名',name:'driverName',id:'driverName',align:'center',minWidth:80},
                    {display:'驾驶员手机号',name:'driverPhone',id:'driverPhone',align:'center',minWidth:80},
                    {
                        display:'驾驶员性别',
                        name:'driverGender',
                        id:'driverGender',
                        align:'center',
                        minWidth:80,
                        render:function(row){
                            if(row.driverGender == 1){
                                return '男';
                            } else if(row.driverGender == 2){
                                return '女';
                            }
                            return '';
                        }
                    },
                    {display:'出生日期',name:'driverBirthday',id:'driverBirthday',align:'center',minWidth:80},
                    {display:'国籍',name:'driverNationality',id:'driverNationality',align:'center',minWidth:80},
                    {display:'驾驶员民族',name:'driverNation',id:'driverNation',align:'center',minWidth:80},
                    {display:'驾驶员婚姻状态',name:'driverMaritalStatus',id:'driverMaritalStatus',align:'center',minWidth:80},
                    {display:'驾驶员外语能力',name:'driverLanguageLevel',id:'driverLanguageLevel',align:'center',minWidth:80},
                    {display:'驾驶员学历',name:'driverEducation',id:'driverEducation',align:'center',minWidth:80},
                    {display:'户口登记机关名称',name:'driverCensus',id:'driverCensus',align:'center',minWidth:80},
                    {display:'户口住址或长住地址',name:'driverAddress',id:'driverAddress',align:'center',minWidth:80},
                    {display:'驾驶员通信地址',name:'driverContactAddress',id:'driverContactAddress',align:'center',minWidth:80},
                    {display:'驾驶员照片文件编号',name:'photoId',id:'photoId',align:'center',minWidth:80},
                    {display:'机动车驾驶证号',name:'licenseId',id:'licenseId',align:'center',minWidth:80},
                    {display:'机动车驾驶证扫描件文件编号',name:'licensePhotoId',id:'licensePhotoId',align:'center',minWidth:80},
                    {display:'准驾车型',name:'driverType',id:'driverType',align:'center',minWidth:80},
                    {display:'初次领取驾驶证日期',name:'getDriverLicenseDate',id:'getDriverLicenseDate',align:'center',minWidth:80},
                    {display:'驾驶证有效期限起',name:'driverLicenseOn',id:'driverLicenseOn',align:'center',minWidth:80},
                    {display:'驾驶证有效期限止',name:'driverLicenseOff',id:'driverLicenseOff',align:'center',minWidth:80},
                    {
                        display:'是否巡游出租汽车驾驶员',
                        name:'taxiDriver',
                        id:'taxiDriver',
                        align:'center',
                        minWidth:80,
                        render:function(row){
                            if(row.taxiDriver == 1){
                                return '是';
                            } else if(row.taxiDriver == 0){
                                return '否';
                            }
                            return '';
                        }
                    },
                    {display:'网络预约出租汽车驾驶员资格证号',name:'certificateNo',id:'certificateNo',align:'center',minWidth:80},
                    {display:'网络预约出租汽车驾驶员证发证机构',name:'NetworkCarIssueOrganization',id:'NetworkCarIssueOrganization',align:'center',minWidth:80},
                    {display:'资格证发证日期',name:'networkCarIssueDate',id:'networkCarIssueDate',align:'center',minWidth:80},
                    {display:'初次领取资格证日期',name:'getNetworkCarProofDate',id:'getNetworkCarProofDate',align:'center',minWidth:80},
                    {display:'资格证有效起始日期',name:'networkCarProofOn',id:'networkCarProofOn',align:'center',minWidth:80},
                    {display:'资格证有效截止日期',name:'networkCarProofOff',id:'networkCarProofOff',align:'center',minWidth:80},
                    {display:'报备日期',name:'registerDate',id:'registerDate',align:'center',minWidth:80},
                    {
                        display:'是否专职驾驶员',
                        name:'fullTimeDriver',
                        id:'fullTimeDriver',
                        align:'center',
                        minWidth:80,
                        render:function(row){
                            if(row.fullTimeDriver == 1){
                                return '是';
                            } else if(row.fullTimeDriver == 0){
                                return '否';
                            }
                            return '';
                        }
                    },
                    {
                        display:'是否在驾驶员黑名单内',
                        name:'inDriverBlacklist',
                        id:'inDriverBlacklist',
                        align:'center',
                        minWidth:80,
                        render:function(row){
                            if(row.inDriverBlacklist == 1){
                                return '是';
                            } else if(row.inDriverBlacklist == 0){
                                return '否';
                            }
                            return '';
                        }
                    },
                    {
                        display:'服务类型',
                        name:'commercialType',
                        id:'commercialType',
                        align:'center',
                        minWidth:80,
                        render:function(row){
                            if(row.commercialType == 1){
                                return '网络预约出租汽车';
                            } else if(row.commercialType == 2){
                                return '巡游出租汽车';
                            } else if(row.commercialType == 3){
                                return '私人小客车合乘';
                            }
                            return '';
                        }
                    },
                    {display:'驾驶员合同（或协议）签署公司',name:'contractCompany',id:'contractCompany',align:'center',minWidth:80},
                    {display:'合同（或协议）有效期起',name:'contractOn',id:'contractOn',align:'center',minWidth:80},
                    {display:'合同（或协议）有效期止',name:'contractOff',id:'contractOff',align:'center',minWidth:80},
                    {display:'紧急情况联系人',name:'emergencyContact',id:'emergencyContact',align:'center',minWidth:80},
                    {display:'紧急情况联系人电话',name:'emergencyContactPhone',id:'emergencyContactPhone',align:'center',minWidth:80},
                    {display:'紧急情况联系人通信地址',name:'emergencyContactAddress',id:'emergencyContactAddress',align:'center',minWidth:80},
                    {
                        display:'状态',
                        name:'state',
                        id:'state',
                        align:'center',
                        minWidth:80,
                        render:function(row){
                            if(row.state == 0){
                                return '有效';
                            } else if(row.state == 1){
                                return '失效';
                            }
                            return '';
                        }
                    },
                    {
                        display:'操作标识',
                        name:'flag',
                        id:'flag',
                        align:'center',
                        minWidth:80,
                        render:function(row){
                            if(row.flag == 1){
                                return '新增';
                            } else if(row.flag == 2){
                                return '更新';
                            } else if(row.flag == 3){
                                return '删除';
                            }
                            return '';
                        }
                    },
                    {display:'更新时间',name:'updateTime',id:'updateTime',align:'center',minWidth:120}
                ],
                onDblClickRow: function (data, rowindex, rowobj){
                    layer.open({
                        title:'${module}',
                        type:2,
                        maxmin:false,
                        area: ['100%', '100%'],
                        content:'${base}/${route}/platform_driver/view/'+data.id
                    });
                }
            });

            function reload(){
                if(ligerTable){
                    var searchKey = $('#txtSearchKey').val();
                    ligerTable.setParm('searchKey',searchKey);
                    ligerTable.reload();
                }
            }
            $('#btnSearch').click(function(){
                reload();
            })
            $('#btnEdit').click(function(){
                if(ligerTable){
                    var row = ligerTable.getSelectedRow();
                    if(!row || row.helpId < 1){
                        layer.msg('请选择行')
                        return;
                    }
                    var id = row.id;
                    var url='${base}/${route}/platform_driver/edit/'+id;
                    changePage(url);
                }
            });
            $('#btnRemove').click(function(){
                if(ligerTable){
                    var row = ligerTable.getSelectedRow();
                    if(!row || row.helpId < 1){
                        layer.msg('请选择行')
                        return;
                    }
                    var id = row.id;
                    layer.confirm('确定要删除吗？',function(){
                        $.ajax({
                            url:'${base}/${route}/platform_driver/remove/'+id,
                            type:'POST',
                            data:{},
                            dataType:'json',
                            success:function(rst){
                                layer.alert(rst.message);
                                if(rst.status=='OK' && ligerTable != null ){
                                    ligerTable.reload();
                                }
                            }
                        });
                    });
                }
            });
        });
        //-->
    </script>
</head>
<body class="$configs["skinName"]">
		<#include "common/breadcrumb.ftl">
<div class="widget-box">
    <div class="widget-header widget-header-flat">
        <h5 class="lighter">
            <i class="fa fa-search"></i>
        ${module}查询
        </h5>
    </div>
    <div class="widget-body">
        <div class="widget-main">
            <div class="row">
                <div class="col-xs-5 col-sm-5">
                    <div class="input-group">
                        <span class="input-group-addon">关键字</span>
                        <input id="txtSearchKey" type="text" class="form-control search-query" placeholder="请输入关键字搜索" />
                        <span class="input-group-btn">
									<button id="btnSearch" type="button" class="btn btn-primary btn-sm">
										查询
										<i class="fa fa-search bigger-110"></i>
									</button>
								</span>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="widget-box">
    <div class="widget-header">
        <h5 class="lighter">
            <i class="icon-table"></i>
        ${module}列表
        </h5>
        <!--非查询者有该操作-->
				<#if user?exists && viewerRole?exists && user.roleId != viewerRole>
				<div class="widget-toolbar">
                    <button id="btnEdit" type="button" class="btn btn-primary btn-xs">
                        <i class="fa fa-check-square-o"></i>编辑
                    </button>
                    <button id="btnRemove" type="button" class="btn btn-primary btn-xs">
                        <i class="fa fa-trash-o"></i>删除
                    </button>
                </div>
                </#if>
    </div>
    <div class="widget-body">
        <div id="table"><div>
        </div>
        </div>
        </body>
</html>